<?php
include_once 'Node.php';

class IterativeInterpreter{
	
	var $parentInterpreter;
	
	public function __construct($p){
		$this->parentInterpreter = $p;
	}	

	public function interpret(Node $node){
		$childs = $node->getChilds();
		
		$ret = '';
		foreach ($childs as $child){
			$ret .= $this->parentInterpreter->interpret($child);
		}

		return $ret;
	}
}